package com.app;

import java.io.IOException;

import com.netwrok.Handler;
import com.netwrok.IoSession;
import com.netwrok.RequestMsg;

public class Myhandler implements Handler {
	@Override
	public void onClose(IoSession session) {
		try {
			System.err.println(session.getAddress().toString()+"close ");
		} catch (IOException e) {
			e.printStackTrace();
		}

	}

	@Override
	public void onNewSession(IoSession session) {
		try {
			System.err.println(session.getAddress().toString()+" new come ");
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

	}

	@Override
	public void onRcvMsg(IoSession session, RequestMsg msg) {
		try {
			System.err.println(session.getAddress().toString()+" msg ");
			session.close();
		} catch (IOException e) {
			e.printStackTrace();
		}

	}
}
